import request from '@/utils/request'

// 查询灾害申报列表
export function listDeclaration(query) {
  return request({
    url: '/system/declaration/list',
    method: 'get',
    params: query
  })
}

// 查询灾害申报详细
export function getDeclaration(id) {
  return request({
    url: '/system/declaration/' + id,
    method: 'get'
  })
}

// 新增灾害申报
export function addDeclaration(data) {
  return request({
    url: '/system/declaration',
    method: 'post',
    data: data
  })
}

// 修改灾害申报
export function updateDeclaration(data) {
  return request({
    url: '/system/declaration',
    method: 'put',
    data: data
  })
}

// 删除灾害申报
export function delDeclaration(id) {
  return request({
    url: '/system/declaration/' + id,
    method: 'delete'
  })
}

export function acceptDeclaration(id) {
  return request({
    url: '/system/declaration/acceptDeclaration?id=' + id,
    method: 'get'
  })
}